/*********************************************************************
	Rhapsody	: 7.6
	Login		: Ryszard
	Component	: DefaultComponent
	Configuration 	: DefaultConfig
	Model Element	: Alarm
//!	Generated Date	: Wed, 23, Nov 2011 
	File Path	: DefaultComponent/DefaultConfig/CargoLiftSystem/Alarm.java
*********************************************************************/

package CargoLiftSystem;

//## link itsIAlarm 
import Hardware.IAlarm;
//## auto_generated
import com.ibm.rational.rhapsody.oxf.*;
//## auto_generated
import com.ibm.rational.rhapsody.oxf.states.*;

//----------------------------------------------------------------------------
// CargoLiftSystem/Alarm.java                                                                  
//----------------------------------------------------------------------------

//## package CargoLiftSystem 


//## class Alarm 
public class Alarm implements RiJStateConcept {
    
    public Reactive reactive;		//## ignore 
    
    protected IAlarm itsIAlarm;		//## link itsIAlarm 
    
    protected Lift itsLift;		//## link itsLift 
    
    
    //## statechart_method 
    public RiJThread getThread() {
        return reactive.getThread();
    }
    
    //## statechart_method 
    public void schedTimeout(long delay, long tmID, RiJStateReactive reactive) {
        getThread().schedTimeout(delay, tmID, reactive);
    }
    
    //## statechart_method 
    public void unschedTimeout(long tmID, RiJStateReactive reactive) {
        getThread().unschedTimeout(tmID, reactive);
    }
    
    //## statechart_method 
    public RiJEventConsumer getEventConsumer() {
        return (RiJEventConsumer)reactive;
    }
    
    //## statechart_method 
    public void gen(RiJEvent event) {
        reactive._gen(event);
    }
    
    //## statechart_method 
    public void queueEvent(RiJEvent event) {
        reactive.queueEvent(event);
    }
    
    //## statechart_method 
    public int takeEvent(RiJEvent event) {
        return reactive.takeEvent(event);
    }
    
    // Constructors
    
    //## auto_generated 
    public  Alarm(RiJThread p_thread) {
        reactive = new Reactive(p_thread);
        initRelations(p_thread);
    }
    
    //## auto_generated 
    public IAlarm getItsIAlarm() {
        return itsIAlarm;
    }
    
    //## auto_generated 
    public void setItsIAlarm(IAlarm p_IAlarm) {
        itsIAlarm = p_IAlarm;
    }
    
    //## auto_generated 
    public Lift getItsLift() {
        return itsLift;
    }
    
    //## auto_generated 
    public void __setItsLift(Lift p_Lift) {
        itsLift = p_Lift;
    }
    
    //## auto_generated 
    public void _setItsLift(Lift p_Lift) {
        if(itsLift != null)
            {
                itsLift.__setItsAlarm(null);
            }
        __setItsLift(p_Lift);
    }
    
    //## auto_generated 
    public Lift newItsLift(RiJThread p_thread) {
        itsLift = new Lift(p_thread);
        itsLift._setItsAlarm(this);
        return itsLift;
    }
    
    //## auto_generated 
    public void deleteItsLift() {
        itsLift.__setItsAlarm(null);
        itsLift=null;
    }
    
    //## auto_generated 
    protected void initRelations(RiJThread p_thread) {
        itsLift = newItsLift(p_thread);
    }
    
    //## auto_generated 
    public boolean startBehavior() {
        boolean done = true;
        done &= itsLift.startBehavior();
        done &= reactive.startBehavior();
        return done;
    }
    
    //## ignore 
    public class Reactive extends RiJStateReactive {
        
        // Default constructor 
        public Reactive() {
            this(RiJMainThread.instance());
        }
        
        
        // Constructors
        
        public  Reactive(RiJThread p_thread) {
            super(p_thread);
        }
        
    }
}
/*********************************************************************
	File Path	: DefaultComponent/DefaultConfig/CargoLiftSystem/Alarm.java
*********************************************************************/

